package com.woniuxy.background.dao;

import com.woniuxy.background.pojo.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface RoleMapper {
    int deleteByPrimaryKey(Integer roleId);

    int insert(Role record);

    int insertSelective(Role record);

    Role selectByPrimaryKey(Integer roleId);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    @Select("select * from role")
    List<Role> selectRoles();

    @Select("select * from role")
    List<Role> selectByPage(@Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize);

    @Select("select * from role where role_name = #{value}")
    Role selectByName(String roleName);
}